<?php
/**
 * Laborator - Fontello Icon Selector
 *
 * Param Type by Arlind Nushi
 *
 * www.laborator.co
 *
 * File Date: 09/16/13
 */

add_shortcode_param('fontelloicon', 'fontello_icon_wpb_param_type');
wp_register_style('vc-icons', THEMEURL . 'inc/lib/visual-composer/assets/icons/css/vc-icons.css', null, null);

add_action('admin_enqueue_scripts', 'lab_vc_fontelloicon');

function lab_vc_fontelloicon()
{
	wp_enqueue_style('vc-icons');
}

function fontello_icon_wpb_param_type($settings, $value)
{
	$dependency = vc_generate_dependencies_attributes($settings);

	$fontello_icon_list = fontello_icon_list();

	$icons_list = '';

	foreach($fontello_icon_list as $icon)
	{
		$ico = '<span data-icon="'.$icon.'" title="'.$icon.'" class="icon-entry vc-icon-'.$icon.'"></span>';

		$icons_list .= $ico;
	}

	$fontello_dir = THEMEURL . 'css/fontello/';

	$url_to_script = THEMEURL . "inc/lib/visual-composer/param-types/fontelloicon/fontelloicon_param_type.js";

	$fontello_css = <<<EOD
<script type="text/javascript" src="{$url_to_script}"></script>
EOD;

	return	$fontello_css .

			'<div class="fontello_icon_wpb_param_type_field">' .
				'<input name="'.$settings['param_name'] .'" class="wpb_vc_param_value laborator_fontello_select wpb-textinput ' . $settings['param_name'].' '.$settings['type'].'_field" type="text" value="'.$value.'" ' . $dependency . '/> ' .
				'<label class="vc-icon-heart"></label>' .
			'</div>' .

			'<div id="fontello_font_list" class="fontello-icon-list">'.
				$icons_list.
				'<div class="clear"></div>' .
			'</div>' .

			'<span></span>';
}

function fontello_icon_list()
{
	$a = array('glass',
'music',
'search',
'mail',
'mail-alt',
'mail-squared',
'heart',
'heart-empty',
'star',
'star-empty',
'star-half',
'star-half-alt',
'user',
'users',
'male',
'female',
'child',
'video',
'videocam',
'picture',
'camera',
'camera-alt',
'th-large',
'th',
'th-list',
'ok',
'ok-circled',
'ok-circled2',
'ok-squared',
'cancel',
'cancel-circled',
'cancel-circled2',
'plus',
'plus-circled',
'plus-squared',
'plus-squared-alt',
'minus',
'minus-circled',
'minus-squared',
'minus-squared-alt',
'help',
'help-circled',
'info-circled',
'info',
'home',
'link',
'unlink',
'link-ext',
'link-ext-alt',
'attach',
'lock',
'lock-open',
'lock-open-alt',
'pin',
'eye',
'eye-off',
'tag',
'tags',
'bookmark',
'bookmark-empty',
'flag',
'flag-empty',
'flag-checkered',
'thumbs-up',
'thumbs-down',
'thumbs-up-alt',
'thumbs-down-alt',
'download',
'upload',
'download-cloud',
'upload-cloud',
'reply',
'reply-all',
'forward',
'quote-left',
'quote-right',
'code',
'export',
'export-alt',
'share',
'share-squared',
'pencil',
'pencil-squared',
'edit',
'print',
'retweet',
'keyboard',
'gamepad',
'comment',
'chat',
'comment-empty',
'chat-empty',
'bell',
'bell-alt',
'bell-off',
'bell-off-empty',
'attention-alt',
'attention',
'attention-circled',
'location',
'direction',
'compass',
'trash',
'trash-empty',
'doc',
'docs',
'doc-text',
'doc-inv',
'doc-text-inv',
'file-pdf',
'file-word',
'file-excel',
'file-powerpoint',
'file-image',
'file-archive',
'file-audio',
'file-video',
'file-code',
'folder',
'folder-open',
'folder-empty',
'folder-open-empty',
'box',
'rss',
'rss-squared',
'phone',
'phone-squared',
'fax',
'menu',
'cog',
'cog-alt',
'wrench',
'sliders',
'basket',
'calendar',
'calendar-empty',
'login',
'logout',
'mic',
'mute',
'volume-off',
'volume-down',
'volume-up',
'headphones',
'clock',
'lightbulb',
'block',
'resize-full',
'resize-full-alt',
'resize-small',
'resize-vertical',
'resize-horizontal',
'move',
'zoom-in',
'zoom-out',
'down-circled2',
'up-circled2',
'left-circled2',
'right-circled2',
'down-dir',
'up-dir',
'left-dir',
'right-dir',
'down-open',
'left-open',
'right-open',
'up-open',
'angle-left',
'angle-right',
'angle-up',
'angle-down',
'angle-circled-left',
'angle-circled-right',
'angle-circled-up',
'angle-circled-down',
'angle-double-left',
'angle-double-right',
'angle-double-up',
'angle-double-down',
'down',
'left',
'right',
'up',
'down-big',
'left-big',
'right-big',
'up-big',
'right-hand',
'left-hand',
'up-hand',
'down-hand',
'left-circled',
'right-circled',
'up-circled',
'down-circled',
'cw',
'ccw',
'arrows-cw',
'level-up',
'level-down',
'shuffle',
'exchange',
'history',
'expand',
'collapse',
'expand-right',
'collapse-left',
'play',
'play-circled',
'play-circled2',
'stop',
'pause',
'to-end',
'to-end-alt',
'to-start',
'to-start-alt',
'fast-fw',
'fast-bw',
'eject',
'target',
'signal',
'wifi',
'award',
'desktop',
'laptop',
'tablet',
'mobile',
'inbox',
'globe',
'sun',
'cloud',
'flash',
'moon',
'umbrella',
'flight',
'fighter-jet',
'paper-plane',
'paper-plane-empty',
'space-shuttle',
'leaf',
'font',
'bold',
'italic',
'header',
'paragraph',
'text-height',
'text-width',
'align-left',
'align-center',
'align-right',
'align-justify',
'list',
'indent-left',
'indent-right',
'list-bullet',
'list-numbered',
'strike',
'underline',
'superscript',
'subscript',
'table',
'columns',
'crop',
'scissors',
'paste',
'briefcase',
'suitcase',
'ellipsis',
'ellipsis-vert',
'off',
'road',
'list-alt',
'qrcode',
'barcode',
'book',
'ajust',
'tint',
'toggle-off',
'toggle-on',
'check',
'check-empty',
'circle',
'circle-empty',
'circle-thin',
'circle-notch',
'dot-circled',
'asterisk',
'gift',
'fire',
'magnet',
'chart-bar',
'chart-area',
'chart-pie',
'chart-line',
'ticket',
'credit-card',
'floppy',
'megaphone',
'hdd',
'key',
'fork',
'rocket',
'bug',
'certificate',
'tasks',
'filter',
'beaker',
'magic',
'cab',
'taxi',
'truck',
'bus',
'bicycle',
'money',
'euro',
'pound',
'dollar',
'rupee',
'yen',
'rouble',
'shekel',
'try',
'won',
'bitcoin',
'sort',
'sort-down',
'sort-up',
'sort-alt-up',
'sort-alt-down',
'sort-name-up',
'sort-name-down',
'sort-number-up',
'sort-number-down',
'hammer',
'gauge',
'sitemap',
'spinner',
'coffee',
'food',
'beer',
'user-md',
'stethoscope',
'ambulance',
'medkit',
'h-sigh',
'hospital',
'building',
'building-filled',
'bank',
'smile',
'frown',
'meh',
'anchor',
'terminal',
'eraser',
'puzzle',
'shield',
'extinguisher',
'bullseye',
'wheelchair',
'language',
'graduation-cap',
'paw',
'spoon',
'cube',
'cubes',
'recycle',
'tree',
'database',
'lifebuoy',
'rebel',
'empire',
'bomb',
'soccer-ball',
'tty',
'binoculars',
'plug',
'newspaper',
'calc',
'copyright',
'at',
'eyedropper',
'brush',
'birthday',
'cc-visa',
'cc-mastercard',
'cc-discover',
'cc-amex',
'cc-paypal',
'cc-stripe',
'adn',
'android',
'angellist',
'apple',
'behance',
'behance-squared',
'bitbucket',
'bitbucket-squared',
'cc',
'codeopen',
'css3',
'delicious',
'deviantart',
'digg',
'dribbble',
'dropbox',
'drupal',
'facebook',
'facebook-squared',
'flickr',
'foursquare',
'git-squared',
'git',
'github',
'github-squared',
'github-circled',
'gittip',
'google',
'gplus',
'gplus-squared',
'gwallet',
'hacker-news',
'html5',
'instagramm',
'ioxhost',
'joomla',
'jsfiddle',
'lastfm',
'lastfm-squared',
'linkedin-squared',
'linux',
'linkedin',
'maxcdn',
'meanpath',
'openid',
'pagelines',
'paypal',
'pied-piper-squared',
'pied-piper-alt',
'pinterest-circled',
'pinterest-squared',
'qq',
'reddit',
'reddit-squared',
'renren',
'skype',
'slack',
'slideshare',
'soundcloud',
'spotify',
'stackexchange',
'stackoverflow',
'steam',
'steam-squared',
'stumbleupon',
'stumbleupon-circled',
'tencent-weibo',
'trello',
'tumblr',
'tumblr-squared',
'twitch',
'twitter-squared',
'twitter',
'vimeo-squared',
'vine',
'vkontakte',
'wechat',
'weibo',
'windows',
'wordpress',
'xing',
'xing-squared',
'yelp',
'youtube',
'yahoo',
'youtube-squared',
'youtube-play',
'blank',
'lemon',
'note',
'note-beamed',
'music-1',
'search-1',
'flashlight',
'mail-1',
'heart-1',
'heart-empty-1',
'star-1',
'star-empty-1',
'user-1',
'users-1',
'user-add',
'video-1',
'picture-1',
'camera-1',
'layout',
'menu-1',
'check-1',
'cancel-1',
'cancel-circled-1',
'cancel-squared',
'plus-1',
'plus-circled-1',
'plus-squared-1',
'minus-1',
'minus-circled-1',
'minus-squared-1',
'help-1',
'help-circled-1',
'info-1',
'info-circled-1',
'back',
'home-1',
'link-1',
'attach-1',
'lock-1',
'lock-open-1',
'eye-1',
'tag-1',
'bookmark-1',
'bookmarks',
'flag-1',
'thumbs-up-1',
'thumbs-down-1',
'download-1',
'upload-1',
'upload-cloud-1',
'reply-1',
'reply-all-1',
'forward-1',
'quote',
'code-1',
'export-1',
'pencil-1',
'feather',
'print-1',
'retweet-1',
'keyboard-1',
'comment-1',
'chat-1',
'bell-1',
'attention-1',
'alert',
'vcard',
'address',
'location-1',
'map',
'direction-1',
'compass-1',
'cup',
'trash-1',
'doc-1',
'docs-1',
'doc-landscape',
'doc-text-1',
'doc-text-inv-1',
'newspaper-1',
'book-open',
'book-1',
'folder-1',
'archive',
'box-1',
'rss-1',
'phone-1',
'cog-1',
'tools',
'share-1',
'shareable',
'basket-1',
'bag',
'calendar-1',
'login-1',
'logout-1',
'mic-1',
'mute-1',
'sound',
'volume',
'clock-1',
'hourglass',
'lamp',
'light-down',
'light-up',
'adjust',
'block-1',
'resize-full-1',
'resize-small-1',
'popup',
'publish',
'window',
'arrow-combo',
'down-circled-1',
'left-circled-1',
'right-circled-1',
'up-circled-1',
'down-open-1',
'left-open-1',
'right-open-1',
'up-open-1',
'down-open-mini',
'left-open-mini',
'right-open-mini',
'up-open-mini',
'down-open-big',
'left-open-big',
'right-open-big',
'up-open-big',
'down-1',
'left-1',
'right-1',
'up-1',
'down-dir-1',
'left-dir-1',
'right-dir-1',
'up-dir-1',
'down-bold',
'left-bold',
'right-bold',
'up-bold',
'down-thin',
'left-thin',
'right-thin',
'up-thin',
'ccw-1',
'cw-1',
'arrows-ccw',
'level-down-1',
'level-up-1',
'shuffle-1',
'loop',
'switch',
'play-1',
'stop-1',
'pause-1',
'record',
'to-end-1',
'to-start-1',
'fast-forward',
'fast-backward',
'progress-0',
'progress-1',
'progress-2',
'progress-3',
'target-1',
'palette',
'list-1',
'list-add',
'signal-1',
'trophy',
'battery',
'back-in-time',
'monitor',
'mobile-1',
'network',
'cd',
'inbox-1',
'install',
'globe-1',
'cloud-1',
'cloud-thunder',
'flash-1',
'moon-1',
'flight-1',
'paper-plane-1',
'leaf-1',
'lifebuoy-1',
'mouse',
'briefcase-1',
'suitcase-1',
'dot',
'dot-2',
'dot-3',
'brush-1',
'magnet-1',
'infinity',
'erase',
'chart-pie-1',
'chart-line-1',
'chart-bar-1',
'chart-area-1',
'tape',
'graduation-cap-1',
'language-1',
'ticket-1',
'water',
'droplet',
'air',
'credit-card-1',
'floppy-1',
'clipboard',
'megaphone-1',
'database-1',
'drive',
'bucket',
'thermometer',
'key-1',
'flow-cascade',
'flow-branch',
'flow-tree',
'flow-line',
'flow-parallel',
'rocket-1',
'gauge-1',
'traffic-cone',
'cc-1',
'cc-by',
'cc-nc',
'cc-nc-eu',
'cc-nc-jp',
'cc-sa',
'cc-nd',
'cc-pd',
'cc-zero',
'cc-share',
'cc-remix',
'github-1',
'github-circled-1',
'flickr-1',
'flickr-circled',
'vimeo',
'vimeo-circled',
'twitter-1',
'twitter-circled',
'facebook-1',
'facebook-circled',
'facebook-squared-1',
'gplus-1',
'gplus-circled',
'pinterest',
'pinterest-circled-1',
'tumblr-1',
'tumblr-circled',
'linkedin-1',
'linkedin-circled',
'dribbble-1',
'dribbble-circled',
'stumbleupon-1',
'stumbleupon-circled-1',
'lastfm-1',
'lastfm-circled',
'rdio',
'rdio-circled',
'spotify-1',
'spotify-circled',
'qq-1',
'instagram',
'dropbox-1',
'evernote',
'flattr',
'skype-1',
'skype-circled',
'renren-1',
'sina-weibo',
'paypal-1',
'picasa',
'soundcloud-1',
'mixi',
'behance-1',
'google-circles',
'vkontakte-1',
'smashing',
'sweden',
'db-shape',
'logo-db',
'windy-rain-inv',
'snow-inv',
'snow-heavy-inv',
'hail-inv',
'clouds-inv',
'clouds-flash-inv',
'temperature',
'compass-2',
'na',
'celcius',
'fahrenheit',
'clouds-flash-alt',
'sun-inv',
'moon-inv',
'cloud-sun-inv',
'cloud-moon-inv',
'cloud-inv',
'cloud-flash-inv',
'drizzle-inv',
'rain-inv',
'windy-inv',
'sunrise',
'sun-1',
'moon-2',
'eclipse',
'mist',
'wind',
'snowflake',
'cloud-sun',
'cloud-moon',
'fog-sun',
'fog-moon',
'fog-cloud',
'fog',
'cloud-2',
'cloud-flash',
'cloud-flash-alt',
'drizzle',
'rain',
'windy',
'windy-rain',
'snow',
'snow-alt',
'snow-heavy',
'hail',
'clouds',
'clouds-flash',
'music-2',
'search-2',
'mail-2',
'heart-2',
'star-2',
'user-2',
'videocam-1',
'camera-2',
'photo',
'attach-2',
'lock-2',
'eye-2',
'tag-2',
'thumbs-up-2',
'pencil-2',
'comment-2',
'location-2',
'cup-1',
'trash-2',
'doc-2',
'note-1',
'cog-2',
'params',
'calendar-2',
'sound-1',
'clock-2',
'lightbulb-1',
'tv',
'desktop-1',
'mobile-2',
'cd-1',
'inbox-2',
'globe-2',
'cloud-3',
'paper-plane-2',
'fire-1',
'graduation-cap-2',
'megaphone-2',
'database-2',
'key-2',
'beaker-1',
'truck-1',
'money-1',
'food-1',
'shop',
'diamond',
't-shirt',
'wallet',
'search-3',
'mail-3',
'heart-3',
'heart-empty-2',
'star-3',
'user-3',
'video-2',
'picture-2',
'th-large-1',
'th-1',
'th-list-1',
'ok-1',
'ok-circle',
'cancel-2',
'cancel-circle',
'plus-circle',
'minus-circle',
'link-2',
'attach-3',
'lock-3',
'lock-open-2',
'tag-3',
'reply-2',
'reply-all-2',
'forward-2',
'code-2',
'retweet-2',
'comment-3',
'comment-alt',
'chat-2',
'attention-2',
'location-3',
'doc-3',
'docs-landscape',
'folder-2',
'archive-1',
'rss-2',
'rss-alt',
'cog-3',
'logout-2',
'clock-3',
'block-2',
'resize-full-2',
'resize-full-circle',
'popup-1',
'left-open-2',
'right-open-2',
'down-circle',
'left-circle',
'right-circle',
'up-circle',
'down-dir-2',
'right-dir-2',
'down-micro',
'up-micro',
'cw-circle',
'arrows-cw-1',
'updown-circle',
'target-2',
'signal-2',
'progress-4',
'progress-5',
'progress-6',
'progress-7',
'progress-8',
'progress-9',
'progress-10',
'progress-11',
'font-1',
'list-2',
'list-numbered-1',
'indent-left-1',
'indent-right-1',
'cloud-4',
'terminal-1',
'facebook-rect',
'twitter-bird',
'vimeo-rect',
'tumblr-rect',
'googleplus-rect',
'linkedin-rect',
'skype-2',
'vkontakte-rect',
'youtube-1',
'odnoklassniki-rect');

	return $a;
}
